#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
        set<int> st1(nums1.begin(), nums1.end());
        set<int> st2(nums2.begin(), nums2.end());
        vector<int> ret;
        for (auto& e : st1)
        {
            if (st2.count(e))
            {
                ret.push_back(e);
            }
        }
        return ret;

    }
};